Fix duplicate content in Python Report Issue template by merging diagnostic data #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes microsoft#25369
Problem
The Python extension's "Report Issue" command was displaying duplicate content in the VSCode issue reporter. This occurred because both the static template (
report_issue_template.md
) and the formatted diagnostic data (report_issue_user_data_template.md
) were being passed to the VSCode issue reporter API simultaneously:This resulted in users seeing both the generic issue template and the diagnostic information, leading to a confusing and cluttered issue reporting experience.
Solution
The fix preserves the structured issue template while eliminating duplication by merging the formatted diagnostic data directly into the template. The diagnostic data now replaces the XXX placeholder in the template's diagnostic section:
Changes
reportIssueCommand.ts
: Modified to merge formatted diagnostic data into the template by replacing the XXX placeholder, then pass only the combined result asissueBody
reportIssueCommand.unit.test.ts
: Updated test expectations to verify the merged template approachThis approach maintains the user guidance from the static template while ensuring diagnostic information is properly embedded without duplication.
Benefits
Testing
All existing unit tests pass, confirming that the diagnostic data formatting and issue reporter integration continue to work correctly with the new merged approach.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.